home *** CD-ROM | disk | FTP | other *** search
/ Champak 66 / Vol 66.iso / games / doodle_d.swf / scripts / frame_4 / DoAction_7.as < prev    next >
Text File  |  2013-04-24  |  943b  |  54 lines

  1. function move()
  2. {
  3.    ox = ship._x;
  4.    oy = ship._y;
  5.    if(ship._x > 0 && ship._x < 640 && ship._y > 0 && ship._y < 880)
  6.    {
  7.       ship._x += dx;
  8.       ship._y += dy;
  9.    }
  10.    else if(dx != 0 && dy != 0)
  11.    {
  12.       control = false;
  13.       controlTimer = 0;
  14.       dx *= -1;
  15.       dy *= -1;
  16.       if(ship._x < 0 || ship._x > 640)
  17.       {
  18.          if(ship._x < 0)
  19.          {
  20.             ship._x += 1;
  21.          }
  22.          else
  23.          {
  24.             ship._x -= 1;
  25.          }
  26.          ship._x += dx;
  27.       }
  28.       else
  29.       {
  30.          if(ship._y < 0)
  31.          {
  32.             ship._y += 1;
  33.          }
  34.          else
  35.          {
  36.             ship._y -= 1;
  37.          }
  38.          ship._y += dy;
  39.       }
  40.       ship._x += dx * 2;
  41.       ship._y += dy * 2;
  42.    }
  43.    controlTimer++;
  44.    if(controlTimer <= 6)
  45.    {
  46.       dir -= 30;
  47.    }
  48.    if(controlTimer == 6)
  49.    {
  50.       speed /= 4;
  51.       control = true;
  52.    }
  53. }
  54.